StartView = function()
{
	Sprite.call(this);
	this.init();
};
FLASH.extend( StartView , Sprite );


/**
 * 重写父类的方法
 */
StartView.prototype.init = function()
{
	this.getGraphics().beginFill("#000000",0.4); //黑色
	this.getGraphics().drawRect(0,0,400,300);
	this.getGraphics().endFill();
	
	var txt = new TextField();
	txt.setX(120);
	txt.setY(80);
	txt.align = TextFieldAlign.LEFT ;
	txt.font="bold 25px Arial";
	txt.color = "#ffffff"; //白色
	txt.text="APPLE DROP";
	this.addChild(txt);
	
	
	//添加开始按钮
	this.playBtn = this.createPlayButton();
	this.playBtn.useHandCursor = true;
	//显示位置
	this.playBtn.setX( 120);
	this.playBtn.setY( 160 );
	this.addChild( this.playBtn);
	
	function playBtnHandler(e){
		e.getTarget().removeEventListener(MouseEvent.CLICK , playBtnHandler );
		GlobalDispatcher.getInstance().dispatchEvent( new GlobalEvent(GlobalEvent.GAME_START));
	}
	//对按钮添加点击侦听
	this.playBtn.addEventListener(MouseEvent.CLICK , playBtnHandler );
};

/**
 * 创建开始按钮
 * @returns {SimpleButton}
 */
StartView.prototype.createPlayButton = function()
{
	var btnBmd = ResManager.getInstance().getBmdByName("gameButton");
	var playBtn = new SimpleButton(btnBmd, btnBmd.getWidth() , (btnBmd.getHeight()/3>>0) );
	//设置按钮的状态
	playBtn.setUpRect( new Rectangle(0,0,playBtn.getWidth() , playBtn.getHeight() ));
	playBtn.setOverRect( new Rectangle(0,playBtn.getHeight(),playBtn.getWidth() , playBtn.getHeight() ));
	playBtn.setDownRect( new Rectangle(0,playBtn.getHeight()*2 , playBtn.getWidth() , playBtn.getHeight() ));
	
	return playBtn ;
};